package com.da.javatest.leetCode;


/**
 * @author chenlida
 * @date 2019/1/11 15:56
 * @description
 */
public class Code485 {
    public int findMaxConsecutiveOnes(int[] nums) {
        int total = 0;
        int temp = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == 0) {
                total = Math.max(temp, total);
                temp = 0;
                continue;
            }
            temp++;
        }
        total = Math.max(temp, total);
        return total;
    }
}
